package com.szml.context;

import com.szml.vo.LoginVO;

//基于ThreadLocal类封装的工具类，用于在同一线程中的封装数据和获取数据
public class BaseContext {

    private static final ThreadLocal<LoginVO> tl = new ThreadLocal<>();

    public static void saveUser(LoginVO loginVO){
        tl.set(loginVO);
    }

    public static LoginVO getLoginVO(){
        return tl.get();
    }

    public static void removeLoginVO(){
        tl.remove();
    }

}
